package designpattern.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * @author zhangxin
 * @date 2020/10/29
 */
public class CglibTest {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();

        enhancer.setSuperclass(MyServiceImpl.class);

        enhancer.setCallback(new ServiceInterceptor());


        MyServiceImpl myService = (MyServiceImpl) enhancer.create();

        myService.test("java");

    }
}
